﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

using Core.Graphics;
using Core.Mapping;

namespace WorldEditor.Tiles
{
    public partial class AutoTilePalletTile : UserControl
    {

        public event EventHandler AutoTileInfoSelected;

        public AutoTileInfo AutoTileInfo { get; set; }

        public AutoTilePalletTile()
        {
            InitializeComponent();
        }

        public void LoadAutoTileInfo()
        {
            pbTile.Image = TileSetTileBitmaps.GetTileBitmap(AutoTileInfo.Plain.SpriteID, TileSetTypes.Terrain);

            lblAutoTileName.Text = AutoTileInfo.Name;
        }

        private void pbTile_Click(object sender, EventArgs e)
        {
            if (AutoTileInfoSelected != null)
                AutoTileInfoSelected.Invoke(this, EventArgs.Empty);
        }
    }
}
